package board;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class PaintBoard extends JFrame{
	
	private int maxHeight;
	private int maxWidth;
	private boolean needScrollY;
	private boolean needScrollX;
	private int[][] board;
	int currentBoardMaxWidth;
	int currentBoardMaxHeight;
	
	public void PaintBoard(int[][] getBoard){
		maxHeight = 20;
		maxWidth = 20;
		
		needScrollX = false;
		needScrollY = false;
	}
	
	public void setBoard(int[][] getBoard){
		board = getBoard;
	}
	
	private void needScrolling(){
		
		currentBoardMaxWidth = 0;
		currentBoardMaxHeight = 0;
		
		if(board.length>0 && board[0].length>0){
			for(int y=0;y<board.length;y++){
				for(int x=0;x<board[y].length;x++){
					if(x<currentBoardMaxWidth) x = currentBoardMaxWidth;
					if(y<currentBoardMaxHeight) y = currentBoardMaxHeight;
				}
			}
		}
		
		if(currentBoardMaxWidth>maxWidth) needScrollX =true;
		if(currentBoardMaxHeight>maxHeight) needScrollY =true;
	}
	
	public void drawBoard(int[][] getBoard){
		
		if(needScrollX == false && needScrollY == false){
			
			for(int y=0;y<maxHeight;y++){
				for(int x=0;x<maxWidth;x++){
					JPanel a = new JPanel();
					
					if(y = currentBoardMaxHeight)
				}
			}
		}
		
		
	}
}
